//
//  ViewController.m
//  NSThread使用
//
//  Created by 李煜 on 2024/3/19.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
	[super viewDidLoad];
	[self m1];
	[self m2];
	[self m3];
}
- (void)m1{
	NSThread *thread = [[NSThread alloc]initWithTarget:self selector:@selector(param:) object:@"111"];
	thread.name = @"target thread";
	thread.threadPriority = .8;
	[thread start];
}
- (void)m2 {
	[NSThread detachNewThreadSelector:@selector(param:) toTarget:self withObject:@"detachNew"];
}
- (void)m3 {
	[self performSelectorInBackground:@selector(param:) withObject:@"perform Selector"];
}
- (void)param:(id)param {
	NSLog(@"--%@--%@--",[NSThread currentThread],param);
}

@end
